package chapter4;
import java.util.Scanner;
/****************************************************************
 * Author：icynlau
 * Description:  改写猜生日，不过改成用户输入Y-是 N-不是
 * Date:2021/4/2
 * ***************************************************************
 */
public class exc4_10 {
	public static void main(String[] args) {
		Scanner input=new Scanner(System.in);
		String set1="\t1\t3\t5\t7\n"+
				"\t9\t11\t13\t15\n"+
				"\t17\t19\t21\t23\n"+
				"\t25\t27\t29\t31";
		String set2="\t2\t3\t6\t7\n"+
				"\t10\t11\t14\t15\n"+
				"\t18\t19\t22\t23\n"+
				"\t26\t27\t30\t31";
		String set3="\t4\t5\t6\t7\n"+
				"\t12\t13\t14\t15\n"+
				"\t20\t21\t22\t23\n"+
				"\t28\t29\t30\t31";
		String set4="\t8\t9\t10\t11\n"+
				"\t12\t13\t14\t15\n"+
				"\t24\t25\t26\t27\n"+
				"\t28\t29\t30\t31";
		String set5="\t16\t17\t18\t19\n"+
				"\t20\t21\t22\t23\n"+
				"\t24\t25\t26\t27\n"+
				"\t28\t29\t30\t31";
		
		int day=0;
		System.out.print("Is you birthday in set1?\n");
		System.out.print(set1);
		System.out.print("\nEnter Y-yes and N-No.\n");
		String s=input.next();
		
		if(s.charAt(0)=='Y') {
			day+=1;
		}
		System.out.print("Is you birthday in set2?\n");
		System.out.print(set2);
		System.out.print("\nEnter Y-yes and N-No.\n");
		s=input.next();
		if(s.charAt(0)=='Y') {
			day+=2;
		}
		System.out.print("Is you birthday in set3?\n");
		System.out.print(set3);
		System.out.print("\nEnter Y-yes and N-No.\n");
		s=input.next();
		if(s.charAt(0)=='Y') {
			day+=4;
		}
		System.out.print("Is you birthday in set4?\n");
		System.out.print(set4);
		System.out.print("\nEnter Y-yes and N-No:\n");
		s=input.next();
		if(s.charAt(0)=='Y') {
			day+=8;
		}
		System.out.print("Is you birthday in set5?\n");
		System.out.print(set5);
		System.out.print("\nEnter Y-yes and N-No.\n");
		s=input.next();
		if(s.charAt(0)=='Y') {
			day+=16;
		}
		System.out.printf("\n Your birthday is %d.", day);
		
	}

}
